<?
    include_once("_edit_profile.php");
    $var = new EditProfile($_POST, $_FILES);
?>
<div id="edit_profile" class="contenido-thickbox">
    <img class="close" cerrar="edit_profile-wrapper" src="<?='http://'.SERVER_NAME.APP_DIR.'/html/img/icon_delete.png'?>" style="float: right;display:block;" />
    <div id="subiendo_imagen" style="display:none"><div style="margin: 0 auto"><img src="../../img/ajax-loader.gif" />Subiendo...</div></div>
    <? if(!$var->opt['subir_imagen']){?>
    <div id="uploadResult"></div>
    <form id="frm_subir_imagen" class="upload" action="edit_profile.php" method="post" enctype="multipart/form-data" target="iframeImagen">
        <table class="form">
            <tbody>
                <tr class="titulo_form">
                    <td colspan="2">Perfil</td>
                </tr>
                <tr>
                    <td class="left"><label class="titulo">Imagen actual</label></td>
                    <td><img style="width:45px;" src="http://<?=SERVER_NAME.APP_DIR?>/avatares/<?=$Usuario->get_Imagen().'?'.rand()?>" /></td>
                </tr>
                <tr>
                    <td class="left"><label class="titulo">Subir imagen</label></td>
                    <td><input type="file" style="clear:both;margin-top:10px;width:50px;" id="imagen" name="imagen" /></td>
                </tr>
            </tbody>
        </table>
        <a class="exec" clase="Common" href="edit_profile()">
            <input type="button" class="bot_form" style="float:right;display:block;" value="Subir" />
        </a>
        <input type="hidden" value="" name="subir_imagen" id="subir_imagen" />
    </form>
    <iframe id="iframeImagen" name="iframeImagen" style="display:none"></iframe>
</div>
<?}else{?>
<script>
    parent.Common.msg_resultado('<?echo $var->opt['error'];?>',0);
    parent.Common.msg_resultado('<?echo $var->opt['msg_ok'];?>',1);
    <?if($var->opt['msg_ok']){?>
        parent.Common.perfil_editado(1);
    <?}else{?>
        parent.Common.perfil_editado(0);
    <?}?>
</script>
<?}?>